MQTT Interface
This document describes the MQTT topics that are used to communicate with viaSens devices.
Before using MQTT to communicate with a certain viaSens device, it needs to be provisioned and its gateway needs to be connected to MQTT broker. Specification relies on the MQTT version 3.1 or higher.
Smart Sensor MQTT Topics
Topic | Description | Retain |
---|---|---|
| Node with the address of Example below shows the packet describing humidity data posted to this topic.
To this topic: Gateway publishes, MQTT broker subscribes. | no |
| Control the node from the Example below shows the packet describing the control of the LED Ring.
To this topic: Gateway subscribes, MQTT broker publishes. | no |
| Configure the node from the Retaining a message ensures that the gateway can hard reset and still be able to collect the configuration of all nodes from the network. Example below shows the packet describing the configuration of a single node.
To this topic: Gateway subscribes, MQTT broker publishes. | yes |
| Node Example below shows the packet describing the metadata of a single node.
To this topic: Gateway publishes, MQTT broker subscribes. | yes |
| Last Will and Testament is a feature of MQTT for notifying the clients when the gateway ungracefully disconnects from the broker. When the gateway connects to the broker, it will send 1 to the presence topic and when it disconnects, the broker will notify other clients by sending 0 to the same topic. These messages are RETAINED which allows other applications to check if the gateway is connected to the broker at any point in time. To this topic: Gateway publishes, MQTT broker subscribes. | yes |
Gateway subscribes to the following topics:
Topic | Description |
---|---|
| Listens for Smart Sensor Data control packets. Fetch the destination node address from topic ( |
| Listens for Smart Sensor Config Data configuration packets. Fetch the destination node address from topic ( |